package com.gxm.base.io.本地IO.练习;

import java.io.*;

public class CopyTextByBufTest {

    /**
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {

        FileReader fr = new FileReader("buf.txt");
        BufferedReader bufr = new BufferedReader(fr);

        FileWriter fw = new FileWriter("buf_copy.txt");
        BufferedWriter bufw = new BufferedWriter(fw);


        String line = null;
        while((line=bufr.readLine())!=null){
            bufw.write(line);
            bufw.newLine();
            bufw.flush();
        }




		/*
		int ch = 0;

		while((ch=bufr.read())!=-1){

			bufw.write(ch);
		}
		*/
        bufw.close();
        bufr.close();
    }

}

